/**
 * 
 */
package com.keggview.application.consts;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.plugin.AbstractUIPlugin;

/**
 * @author Pablo
 * class which contains all icons used in KeggView
 * 
 */
public class Images {
	protected Images() {
	}

	private static ImageRegistry ir;
	{
		ir.put(CIRCLE, AbstractUIPlugin.imageDescriptorFromPlugin(
				"com.keggview.application", "icons/circle.png"));
		ir.put(RECTANGLE, AbstractUIPlugin.imageDescriptorFromPlugin(
				"com.keggview.application", "icons/rectangle.png"));
		ir.put(OVAL, AbstractUIPlugin.imageDescriptorFromPlugin(
				"com.keggview.application", "icons/oval.png"));
	}

	/**
	 * constant describing round icon 
	 */
	public static final String CIRCLE = new String("CIRCLE");
	/**
	 * constant describing rectangle icon 
	 */
	public static final String RECTANGLE = new String("RECTANGLE");
	/**
	 * constant describing oval icon 
	 */
	public static final String OVAL = new String("OVAL");
	/**
	 * default icon 
	 */

	public void dispose() {
		ir.dispose();
	}

	/**
	 * gets ImageDescriptor which have  
	 * @param key
	 * @return
	 */
	public static ImageDescriptor getImageDescriptor(String key) {
		return ir.getDescriptor(key);
	}
	
	public static Image getImage(String key) {
		return ir.get(key);
	}
}
